package com.haiheng.library_base.http

import androidx.core.location.GnssStatusCompat
import okhttp3.MultipartBody
import okhttp3.RequestBody
import okhttp3.ResponseBody
import org.json.JSONStringer
import retrofit2.http.*

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/4/15 0015
 * @Version: 1.0
 */
interface ApiService {
    @GET
    suspend fun download(
        @Url url: String = "",
        @HeaderMap header: Map<String, String>
    ): ResponseBody

    @POST
    suspend fun form(
        @Url url: String = "",
        @HeaderMap header: Map<String, String>,
        @Body body: MultipartBody
    ): ResponseBody

    @FormUrlEncoded
    @POST
    suspend fun post(
        @Url url: String = "",
        @HeaderMap header: Map<String, String>,
        @FieldMap  params: Map<String, String>
    ): ResponseBody


    @Headers("Content-Type: application/json", "Accept: */*")//需要添加头
    @POST
    suspend fun post(
        @Url url: String = "",
        @HeaderMap header: Map<String, String>,
        @Body requestBody : RequestBody
    ): ResponseBody

    @GET
    suspend fun get(
        @Url url: String = "",
        @HeaderMap header: Map<String, String>
    ): ResponseBody


}